<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8" />
    <title></title>
    <meta name="description" content="overview & stats" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script type="text/javascript" src="js/config.js"></script>
    <script type="text/javascript">

        LAMJS.main(function() {
            'use strict';
            var System = this;
            System.defined(System,'baseUrl',{});
            System.admin_url='./admin';
            System.Loadcommon
                    .load({
                        'baseUrl':System.admin_url,
                        'suffix':'.css',
                        'rel':'stylesheet',
                        'css':[
                            //basic styles
                            '/static/css/bootstrap.min',
                            '/static/css/bootstrap-responsive.min',
                            '/static/css/font-awesome.min',
                            //page specific plugin styles
                            //下拉框
//                            '/static/css/chosen',
                            //ace styles
                            '/static/css/ace.min',
                            '/static/css/ace-responsive.min',
                            '/static/css/ace-skins.min'
                            //日期框
//                            '/static/css/datepicker'
                        ]
                    }).load({
                        'baseUrl':'',
                        'suffix':'.css',
                        'rel':'stylesheet',
                        'css':[
                            'css/lhh_lib'
                        ]
                    }).print();


        });
    </script>
    <style type="text/css">
        body.content{padding: 0;}
    </style>
</head>
<body class="content">
<div class="row _lhh_breadcrumb MB10 visible-lg PL15">
    <ul class="breadcrumb pull-left">
        <li><a href="index.html">首页</a></li>
        <li class="active">当日电量</li>
    </ul>
    <div class="p-rel">
        <div class="_lhh_breadcrumb-more MR15">
            <!--电子时钟 begin-->
            <include file="./include/clock.html" dataType="html"></include>
            <!--电子时钟 end-->
        </div>
    </div>

</div>
<div class="container-fluid" id="main-container">


    <div id="page-content" class="clearfix">

        <div class="row-fluid">


            <div class="row-fluid">

                <!-- 检索  -->
                <form action="user/listUsers.do" method="post" name="userForm" id="userForm">
                    <table>
                        <tr>
                            <td>
						<span class="input-icon">
							<input autocomplete="off" id="nav-search-input" type="text" name="USERNAME" value="" placeholder="这里输入关键词" />
							<i id="nav-search-icon" class="icon-search"></i>
						</span>
                            </td>
                            <td style="vertical-align:top;"><button class="btn btn-mini btn-light" onclick="search();" title="检索"><i id="nav-search-icon" class="icon-search"></i></button></td>




                        </tr>
                    </table>
                    <!-- 检索  -->


                    <table id="table_report" class="table table-striped table-bordered table-hover">

                        <thead>
                        <tr>
                            <th class="center">
                                <label><input type="checkbox" id="zcheckbox" /><span class="lbl"></span></label>
                            </th>
                            <th>序号</th>
                            <th>编号</th>
                            <th>用户名</th>
                            <th>姓名</th>
                            <th>职位</th>
                            <th><i class="icon-envelope"></i>邮箱</th>
                            <th><i class="icon-time hidden-phone"></i>最近登录</th>
                            <th>上次登录IP</th>
                            <th class="center">操作</th>
                        </tr>
                        </thead>

                        <tbody>

                        <!-- 开始循环 -->





                        <tr>
                            <td class='center' style="width: 30px;">
                                <label><input type='checkbox' name='ids' value="b825f152368549069be79e1d34184afa" id="sdfsdf@qq.com" alt="18765656565"/><span class="lbl"></span></label>

                            </td>
                            <td class='center' style="width: 30px;">1</td>
                            <td>sdsaw22</td>
                            <td><a>san</a></td>
                            <td>三</td>
                            <td>超级管理员</td>

                            <td><a title="发送电子邮件" style="text-decoration:none;cursor:pointer;" onclick="sendEmail('sdfsdf@qq.com');">sdfsdf@qq.com&nbsp;<i class="icon-envelope"></i></a></td>


                            <td>2015-08-03 14:18:14</td>
                            <td>127.0.0.1</td>
                            <td style="width: 60px;">
                                <div class='hidden-phone visible-desktop btn-group'>


                                    <a class='btn btn-mini btn-warning' title="发送短信" onclick="sendSms('18765656565');"><i class='icon-envelope'></i></a>



                                    <a class='btn btn-mini btn-info' title="编辑" onclick="editUser('b825f152368549069be79e1d34184afa');"><i class='icon-edit'></i></a>






                                    <a class='btn btn-mini btn-danger' title="删除" onclick="delUser('b825f152368549069be79e1d34184afa','san');"><i class='icon-trash'></i></a>



                                </div>
                            </td>
                        </tr>



                        <tr>
                            <td class='center' style="width: 30px;">
                                <label><input type='checkbox' name='ids' value="0b3f2ab1896b47c097a81d322697446a" id="wwwwq@qq.com" alt="18788888888"/><span class="lbl"></span></label>

                            </td>
                            <td class='center' style="width: 30px;">2</td>
                            <td>1101</td>
                            <td><a>zhangsan</a></td>
                            <td>张三</td>
                            <td>超级管理员</td>

                            <td><a title="发送电子邮件" style="text-decoration:none;cursor:pointer;" onclick="sendEmail('wwwwq@qq.com');">wwwwq@qq.com&nbsp;<i class="icon-envelope"></i></a></td>


                            <td>2015-06-03 22:09:13</td>
                            <td>127.0.0.1</td>
                            <td style="width: 60px;">
                                <div class='hidden-phone visible-desktop btn-group'>


                                    <a class='btn btn-mini btn-warning' title="发送短信" onclick="sendSms('18788888888');"><i class='icon-envelope'></i></a>



                                    <a class='btn btn-mini btn-info' title="编辑" onclick="editUser('0b3f2ab1896b47c097a81d322697446a');"><i class='icon-edit'></i></a>






                                    <a class='btn btn-mini btn-danger' title="删除" onclick="delUser('0b3f2ab1896b47c097a81d322697446a','zhangsan');"><i class='icon-trash'></i></a>



                                </div>
                            </td>
                        </tr>



                        <tr>
                            <td class='center' style="width: 30px;">
                                <label><input type='checkbox' name='ids' value="089d664844f8441499955b3701696fc0" id="asdadf@qq.com" alt="18766666666"/><span class="lbl"></span></label>

                            </td>
                            <td class='center' style="width: 30px;">3</td>
                            <td>1231</td>
                            <td><a>fushide</a></td>
                            <td>富师德</td>
                            <td>超级管理员</td>

                            <td><a title="发送电子邮件" style="text-decoration:none;cursor:pointer;" onclick="sendEmail('asdadf@qq.com');">asdadf@qq.com&nbsp;<i class="icon-envelope"></i></a></td>


                            <td></td>
                            <td></td>
                            <td style="width: 60px;">
                                <div class='hidden-phone visible-desktop btn-group'>


                                    <a class='btn btn-mini btn-warning' title="发送短信" onclick="sendSms('18766666666');"><i class='icon-envelope'></i></a>



                                    <a class='btn btn-mini btn-info' title="编辑" onclick="editUser('089d664844f8441499955b3701696fc0');"><i class='icon-edit'></i></a>






                                    <a class='btn btn-mini btn-danger' title="删除" onclick="delUser('089d664844f8441499955b3701696fc0','fushide');"><i class='icon-trash'></i></a>



                                </div>
                            </td>
                        </tr>



                        <tr>
                            <td class='center' style="width: 30px;">
                                <label><input type='checkbox' name='ids' value="0e2da7c372e147a0b67afdf4cdd444a3" id="q324@qq.com" alt="18767676767"/><span class="lbl"></span></label>

                            </td>
                            <td class='center' style="width: 30px;">4</td>
                            <td>dsfsdddd</td>
                            <td><a>dfsdf</a></td>
                            <td>wqeqw</td>
                            <td>黄金客户</td>

                            <td><a title="发送电子邮件" style="text-decoration:none;cursor:pointer;" onclick="sendEmail('q324@qq.com');">q324@qq.com&nbsp;<i class="icon-envelope"></i></a></td>


                            <td></td>
                            <td></td>
                            <td style="width: 60px;">
                                <div class='hidden-phone visible-desktop btn-group'>


                                    <a class='btn btn-mini btn-warning' title="发送短信" onclick="sendSms('18767676767');"><i class='icon-envelope'></i></a>



                                    <a class='btn btn-mini btn-info' title="编辑" onclick="editUser('0e2da7c372e147a0b67afdf4cdd444a3');"><i class='icon-edit'></i></a>






                                    <a class='btn btn-mini btn-danger' title="删除" onclick="delUser('0e2da7c372e147a0b67afdf4cdd444a3','dfsdf');"><i class='icon-trash'></i></a>



                                </div>
                            </td>
                        </tr>



                        <tr>
                            <td class='center' style="width: 30px;">
                                <label><input type='checkbox' name='ids' value="3d3bacf7535444cda51f23711e32c0b2" id="12312315@qq.com" alt="18777777878"/><span class="lbl"></span></label>

                            </td>
                            <td class='center' style="width: 30px;">5</td>
                            <td>223</td>
                            <td><a>sss</a></td>
                            <td>中丧生</td>
                            <td>管理员A</td>

                            <td><a title="发送电子邮件" style="text-decoration:none;cursor:pointer;" onclick="sendEmail('12312315@qq.com');">12312315@qq.com&nbsp;<i class="icon-envelope"></i></a></td>


                            <td></td>
                            <td></td>
                            <td style="width: 60px;">
                                <div class='hidden-phone visible-desktop btn-group'>


                                    <a class='btn btn-mini btn-warning' title="发送短信" onclick="sendSms('18777777878');"><i class='icon-envelope'></i></a>



                                    <a class='btn btn-mini btn-info' title="编辑" onclick="editUser('3d3bacf7535444cda51f23711e32c0b2');"><i class='icon-edit'></i></a>






                                    <a class='btn btn-mini btn-danger' title="删除" onclick="delUser('3d3bacf7535444cda51f23711e32c0b2','sss');"><i class='icon-trash'></i></a>



                                </div>
                            </td>
                        </tr>



                        <tr>
                            <td class='center' style="width: 30px;">
                                <label><input type='checkbox' name='ids' value="79d9e8d227d14902871e162950d17356" id="zhangsassn@www.com" alt="18765656556"/><span class="lbl"></span></label>

                            </td>
                            <td class='center' style="width: 30px;">6</td>
                            <td>121121</td>
                            <td><a>xinyonghu</a></td>
                            <td>新用户22</td>
                            <td>超级管理员</td>

                            <td><a title="发送电子邮件" style="text-decoration:none;cursor:pointer;" onclick="sendEmail('zhangsassn@www.com');">zhangsassn@www.com&nbsp;<i class="icon-envelope"></i></a></td>


                            <td></td>
                            <td></td>
                            <td style="width: 60px;">
                                <div class='hidden-phone visible-desktop btn-group'>


                                    <a class='btn btn-mini btn-warning' title="发送短信" onclick="sendSms('18765656556');"><i class='icon-envelope'></i></a>



                                    <a class='btn btn-mini btn-info' title="编辑" onclick="editUser('79d9e8d227d14902871e162950d17356');"><i class='icon-edit'></i></a>






                                    <a class='btn btn-mini btn-danger' title="删除" onclick="delUser('79d9e8d227d14902871e162950d17356','xinyonghu');"><i class='icon-trash'></i></a>



                                </div>
                            </td>
                        </tr>



                        <tr>
                            <td class='center' style="width: 30px;">
                                <label><input type='checkbox' name='ids' value="8009132b158748a5a84510f91a291119" id="12312312@qq.com" alt="18765810587"/><span class="lbl"></span></label>

                            </td>
                            <td class='center' style="width: 30px;">7</td>
                            <td>2312</td>
                            <td><a>asdasd</a></td>
                            <td>sdsdf</td>
                            <td>管理员B</td>

                            <td><a title="发送电子邮件" style="text-decoration:none;cursor:pointer;" onclick="sendEmail('12312312@qq.com');">12312312@qq.com&nbsp;<i class="icon-envelope"></i></a></td>


                            <td></td>
                            <td></td>
                            <td style="width: 60px;">
                                <div class='hidden-phone visible-desktop btn-group'>


                                    <a class='btn btn-mini btn-warning' title="发送短信" onclick="sendSms('18765810587');"><i class='icon-envelope'></i></a>



                                    <a class='btn btn-mini btn-info' title="编辑" onclick="editUser('8009132b158748a5a84510f91a291119');"><i class='icon-edit'></i></a>






                                    <a class='btn btn-mini btn-danger' title="删除" onclick="delUser('8009132b158748a5a84510f91a291119','asdasd');"><i class='icon-trash'></i></a>



                                </div>
                            </td>
                        </tr>



                        <tr>
                            <td class='center' style="width: 30px;">
                                <label><input type='checkbox' name='ids' value="be025a79502e433e820fac37ddb1cfc2" id="zhangsan@www.com" alt="2147483647"/><span class="lbl"></span></label>

                            </td>
                            <td class='center' style="width: 30px;">8</td>
                            <td>21101</td>
                            <td><a>zhangsan570256</a></td>
                            <td>张三</td>
                            <td>超级管理员</td>

                            <td><a title="发送电子邮件" style="text-decoration:none;cursor:pointer;" onclick="sendEmail('zhangsan@www.com');">zhangsan@www.com&nbsp;<i class="icon-envelope"></i></a></td>


                            <td></td>
                            <td></td>
                            <td style="width: 60px;">
                                <div class='hidden-phone visible-desktop btn-group'>


                                    <a class='btn btn-mini btn-warning' title="发送短信" onclick="sendSms('2147483647');"><i class='icon-envelope'></i></a>



                                    <a class='btn btn-mini btn-info' title="编辑" onclick="editUser('be025a79502e433e820fac37ddb1cfc2');"><i class='icon-edit'></i></a>






                                    <a class='btn btn-mini btn-danger' title="删除" onclick="delUser('be025a79502e433e820fac37ddb1cfc2','zhangsan570256');"><i class='icon-trash'></i></a>



                                </div>
                            </td>
                        </tr>










                        </tbody>
                    </table>

                    <div class="page-header position-relative">
                        <table style="width:100%;">
                            <tr>
                                <td style="vertical-align:top;">

                                    <a class="btn btn-small btn-success" onclick="add();">新增</a>


                                    <a title="批量删除" class="btn btn-small btn-danger" onclick="makeAll('确定要删除选中的数据吗?');" ><i class='icon-trash'></i></a>

                                </td>
                                <td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">	<ul>
                                    <li><a>共<font color=red>8</font>条</a></li>
                                    <li><input type="number" value="" id="toGoPage" style="width:50px;text-align:center;float:left" placeholder="页码"/></li>
                                    <li style="cursor:pointer;"><a onclick="toTZ();"  class="btn btn-mini btn-success">跳转</a></li>
                                    <li><a>首页</a></li>
                                    <li><a>上页</a></li>
                                    <li><a><font color='#808080'>1</font></a></li>
                                    <li><a>下页</a></li>
                                    <li><a>尾页</a></li>
                                    <li><a>第1页</a></li>
                                    <li><a>共1页</a></li>
                                    <li><select title='显示条数' style="width:55px;float:left;" onchange="changeCount(this.value)">
                                        <option value='10'>10</option>
                                        <option value='10'>10</option>
                                        <option value='20'>20</option>
                                        <option value='30'>30</option>
                                        <option value='40'>40</option>
                                        <option value='50'>50</option>
                                        <option value='60'>60</option>
                                        <option value='70'>70</option>
                                        <option value='80'>80</option>
                                        <option value='90'>90</option>
                                        <option value='99'>99</option>
                                    </select>
                                    </li>
                                </ul>

                                </div></td>
                            </tr>
                        </table>
                    </div>
                </form>
            </div>




            <!-- PAGE CONTENT ENDS HERE -->
        </div><!--/row-->

    </div><!--/#page-content-->
</div><!--/.fluid-container#main-container-->



<script type="text/javascript">

    LAMJS.main(function() {
        'use strict';
        var System = this;


        System.import([
            //                '/static/js/jquery-1.7.2',
                        //引入弹窗组件start
                        '/plugins/attention/zDialog/zDrag',
                        '/plugins/attention/zDialog/zDialog',
                        //引入弹窗组件end
                        '/static/js/jquery.tips',

                        '/static/js/bootstrap.min',
                        '/static/js/ace-elements.min',
                        '/static/js/ace.min',
                        //下拉框
                        '/static/js/chosen.jquery.min',
                        //日期框
//                        '/static/js/bootstrap-datepicker.min',
                        //确认窗口
                        '/static/js/bootbox.min',
                        //提示框
                        '/static/js/jquery.tips'

                    ],System.admin_url)
                .import([
                        '/use'

                        ],'./js');
    });
</script>

<script type="text/javascript">




    //检索
    function search(){
        
        $("#userForm").submit();
    }



    //新增
    function add(){
        
        var diag = new top.Dialog();
        diag.Drag=true;
        diag.Title ="新增";
        diag.URL = 'http://192.168.66.118:80/FHMYSQL/user/goAddU.do';
        diag.Width = 225;
        diag.Height = 415;
        diag.CancelEvent = function(){ //关闭事件
            if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
                if('1' == '0'){
                    
                    setTimeout("self.location=self.location",100);
                }else{
                    nextPage(1);
                }
            }
            diag.close();
        };
        diag.show();
    }

    //修改
    function editUser(user_id){
        

    }

    //删除
    function delUser(userId,msg){
        bootbox.confirm("确定要删除["+msg+"]吗?", function(result) {
            if(result) {
                
                var url = "http://192.168.66.118:80/FHMYSQL/user/deleteU.do?USER_ID="+userId+"&tm="+new Date().getTime();
                $.get(url,function(data){
                    nextPage(1);
                });
            }
        });
    }

    //批量操作
    function makeAll(msg){
        bootbox.confirm(msg, function(result) {
            if(result) {
                var str = '';
                var emstr = '';
                var phones = '';
                for(var i=0;i < document.getElementsByName('ids').length;i++)
                {
                    if(document.getElementsByName('ids')[i].checked){
                        if(str=='') str += document.getElementsByName('ids')[i].value;
                        else str += ',' + document.getElementsByName('ids')[i].value;

                        if(emstr=='') emstr += document.getElementsByName('ids')[i].id;
                        else emstr += ';' + document.getElementsByName('ids')[i].id;

                        if(phones=='') phones += document.getElementsByName('ids')[i].alt;
                        else phones += ';' + document.getElementsByName('ids')[i].alt;
                    }
                }
                if(str==''){
                    bootbox.dialog("您没有选择任何内容!",
                            [
                                {
                                    "label" : "关闭",
                                    "class" : "btn-small btn-success",
                                    "callback": function() {
                                        //Example.show("great success");
                                    }
                                }
                            ]
                    );

                    $("#zcheckbox").tips({
                        side:3,
                        msg:'点这里全选',
                        bg:'#AE81FF',
                        time:8
                    });

                    return;
                }else{
                    if(msg == '确定要删除选中的数据吗?'){
                        
                        $.ajax({
                            type: "POST",
                            url: 'http://192.168.66.118:80/FHMYSQL/user/deleteAllU.do?tm='+new Date().getTime(),
                            data: {USER_IDS:str},
                            dataType:'json',
                            //beforeSend: validateData,
                            cache: false,
                            success: function(data){
                                $.each(data.list, function(i, list){
                                    nextPage(1);
                                });
                            }
                        });
                    }else if(msg == '确定要给选中的用户发送邮件吗?'){
                        sendEmail(emstr);
                    }else if(msg == '确定要给选中的用户发送短信吗?'){
                        sendSms(phones);
                    }


                }
            }
        });
    }



    function nextPage(page){
        
        if(true && document.forms[0]){
            var url = document.forms[0].getAttribute("action");
            if(url.indexOf('?')>-1){url += "&currentPage=";}
            else{url += "?currentPage=";}
            url = url + page + "&showCount=10";
            document.forms[0].action = url;
            document.forms[0].submit();
        }else{
            var url = document.location+'';
            if(url.indexOf('?')>-1){
                if(url.indexOf('currentPage')>-1){
                    var reg = /currentPage=\d*/g;
                    url = url.replace(reg,'currentPage=');
                }else{
                    url += "&currentPage=";
                }
            }else{url += "?currentPage=";}
            url = url + page + "&showCount=10";
            document.location = url;
        }
    }
    function changeCount(value){
        
        if(true && document.forms[0]){
            var url = document.forms[0].getAttribute("action");
            if(url.indexOf('?')>-1){
                url += "&currentPage=";
            }else{
                url += "?currentPage=";
            }
            url = url + "1&showCount="+value;
            document.forms[0].action = url;
            document.forms[0].submit();
        }else{
            var url = document.location+'';
            if(url.indexOf('?')>-1){
                if(url.indexOf('currentPage')>-1){
                    var reg = /currentPage=\d*/g;
                    url = url.replace(reg,'currentPage=');
                }else{
                    url += "1&currentPage=";
                }
            }else{url += "?currentPage=";}
            url = url + "&showCount="+value;
            document.location = url;
        }
    }
    function toTZ(){
        var toPaggeVlue = document.getElementById("toGoPage").value;
        if(toPaggeVlue == ''){
            document.getElementById("toGoPage").value=1;
            return;
        }
        if(isNaN(Number(toPaggeVlue))){
            document.getElementById("toGoPage").value=1;
            return;

        }
        nextPage(toPaggeVlue);
    }

    LAMJS.run(function(){
        'use strict';
        var System=this;
        System.Html.include($('include'));
        var I=System.modules.exports.I;

        $(function() {
            //复选框
            $('table th input:checkbox').on('click' , function(){
                var that = this;
                $(this).closest('table').find('tr > td:first-child input:checkbox')
                        .each(function(){
                            this.checked = that.checked;
                            $(this).closest('tr').toggleClass('selected');
                        });

            });

        });

    });
</script>

</body>
</html>

